package com.inxedu.os.edu.service.teacher.teacherImpl;

import com.inxedu.os.edu.dao.EduTeacherMapper;
import com.inxedu.os.edu.pojo.EduTeacher;
import com.inxedu.os.edu.pojo.QueryTeacher;
import com.inxedu.os.edu.service.teacher.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private EduTeacherMapper eduTeacherMapper;

    /**
     * 模糊查询教师列表
     * @param queryTeacher
     * @return
     */
    @Override
    public List<EduTeacher> selectTeacherList(QueryTeacher queryTeacher) {
        return eduTeacherMapper.selectTeacherList(queryTeacher);
    }

    @Override
    public EduTeacher getTeacherById(int id) {
        EduTeacher eduTeacher = eduTeacherMapper.selectByPrimaryKey(id);
        return eduTeacher;
    }

    @Override
    public int updateTeacher(EduTeacher teacher) {
        return eduTeacherMapper.updateTeacher(teacher);
    }

    @Override
    public int deleteTeacherById(int id) {
        return eduTeacherMapper.deleteTeacherById(id);
    }

    @Override
    public int addTeacher(EduTeacher teacher) {
        return eduTeacherMapper.insert(teacher);
    }
}
